from src.lib.pathEngine import hfsPath, WindowsPath, Path

import typing
from typing import Protocol

from .error_code import ErrorCode_for_FileOperations
from .enum import NodeType, FileType

class PathOperationProtocol(Protocol):
    @staticmethod
    def list_dir(self, path: Path): tuple[ErrorCode_for_FileOperations, list[Path]]

    @staticmethod
    def show_node_type(self, path: Path) -> tuple[ErrorCode_for_FileOperations, NodeType, FileType]:...

    @staticmethod
    def is_dir(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    @staticmethod
    def mkdir(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...
    @staticmethod
    def mkdir_recursive(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    @staticmethod
    def remove(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...
    @staticmethod
    def remove_recursive(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    @staticmethod
    def mv(self, path: Path, new_path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    @staticmethod
    def copy(self, path: Path, new_path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    @staticmethod
    def touch(self, path: Path) -> tuple[ErrorCode_for_FileOperations, bool]:...

    # TODO 流式读取文件
    # TODO 流式写入文件

